package com.zjitc.dao;

import com.zjitc.model.User;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class UserRowMapper implements RowMapper<User> {
    public User mapRow(ResultSet resultSet, int i) throws SQLException {
        String name=resultSet.getString("name");
        String idNumber=resultSet.getString("id_number");
        int age=resultSet.getInt("age");
        User user=new User();
        user.setName(name);
        user.setAge(age);
        user.setIdNumber(idNumber);
        return user;
    }
}
